<?php

namespace app\admin\logic;

use app\common\model\mysql\ConfigModel;
use app\common\logic\BaseLogic;

class ConfigLogic extends BaseLogic
{
    public function index($request)
    {

        $info = ConfigModel::getOne(['id' => 1]);;
        return view('Config/config', compact('info'));
    }


    public function save($request)
    {
        $param = $request->param();

        $inputData = [
            'content' => $param['content'],
        ];
        try {
            ConfigModel::editData($inputData, ['id' => 1]);
        } catch (\Exception $e) {
            return $this->responseError('操作失败');
        }
        return $this->responseSuccess('操作成功');
    }
}